/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package consultorio;

import java.awt.BorderLayout;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;

/**
 *
 * @author Unknown
 */
public class Principal extends javax.swing.JFrame {

    /**
     * Creates new form Login
     */
    public Principal() {
        initComponents();
        setLocationRelativeTo(null);
        setResizable (false);
        setTitle("Consultorio Tú Te Sanas");
        try{
       setIconImage(new ImageIcon (getClass().getResource("/Imagenes/logoct.jpg")).getImage()); }
        catch (Exception ex){
                }
                
        //imagen fondo
       ((JPanel) getContentPane()).setOpaque(false);
        ImageIcon imagen = new ImageIcon(this.getClass().getResource("/Imagenes/Fondoct.jpg"));
       JLabel fondo = new JLabel();
       fondo.setIcon(imagen);
       getLayeredPane().add(fondo, JLayeredPane.FRAME_CONTENT_LAYER);
       fondo.setBounds(0, 0, imagen.getIconWidth(), imagen.getIconHeight());
       this.add(fondo, BorderLayout.CENTER);
       this.setSize(fondo.getWidth(), fondo.getHeight());
       this.setLocationRelativeTo(null); 
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jBMedico = new javax.swing.JButton();
        jBPaciente = new javax.swing.JButton();
        jBSalir = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        jPanel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));

        jBMedico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/btnmedico1.jpg"))); // NOI18N
        jBMedico.setBorder(null);
        jBMedico.setBorderPainted(false);
        jBMedico.setContentAreaFilled(false);
        jBMedico.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jBMedico.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBMedico.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/btnmedico2.jpg"))); // NOI18N
        jBMedico.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/btnmedico3.jpg"))); // NOI18N
        jBMedico.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        jBMedico.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jBMedico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBMedicoActionPerformed(evt);
            }
        });

        jBPaciente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/paciente1.jpg"))); // NOI18N
        jBPaciente.setBorder(null);
        jBPaciente.setBorderPainted(false);
        jBPaciente.setContentAreaFilled(false);
        jBPaciente.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBPaciente.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/paciente2.jpg"))); // NOI18N
        jBPaciente.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/paciente3.jpg"))); // NOI18N
        jBPaciente.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        jBPaciente.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jBPaciente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBPacienteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jBMedico, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBPaciente, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(19, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(2, 2, 2)
                .addComponent(jBMedico)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBPaciente)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jBSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/1416604307_shutdown.png"))); // NOI18N
        jBSalir.setText("Salir");
        jBSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBSalirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(373, Short.MAX_VALUE)
                .addComponent(jBSalir)
                .addGap(41, 41, 41))
            .addGroup(layout.createSequentialGroup()
                .addGap(80, 80, 80)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(46, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jBSalir)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSalirActionPerformed
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_jBSalirActionPerformed

    private void jBPacienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBPacienteActionPerformed
        ConsultaMedica obj=new ConsultaMedica();        
        obj.setVisible(true);
        dispose();
    }//GEN-LAST:event_jBPacienteActionPerformed

    private void jBMedicoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBMedicoActionPerformed
        // TODO add your handling code here:
        LoginMedico obj=new LoginMedico();
        obj.setVisible(true);
        dispose();
    }//GEN-LAST:event_jBMedicoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Principal().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBMedico;
    private javax.swing.JButton jBPaciente;
    private javax.swing.JButton jBSalir;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}
